package com.ethink.warehouse.api.request;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 库存拆卸记录 更新请求对象
 *
 * @author default
 * @date 2022-12-07
 */
@Data
public class MateInventoryCxLogUpdateRequest {

    @Schema(description ="主键")
    @NotNull(message = "主键不能为空")
    private Long id;

    @Schema(description ="分仓编号")
    @NotNull(message = "分仓编号不能为空")
    private String subWarehouseCode;

    @Schema(description ="分仓名称")
    @NotNull(message = "分仓名称不能为空")
    private String subWarehouseName;

    @Schema(description ="拆成几份")
    @NotNull(message = "拆成几份不能为空")
    private Integer chaiQty;

    @Schema(description ="备注信息")
    private String remark;

    @Schema(description ="明细")
    @NotNull(message = "明细不能为空")
    @NotEmpty(message = "明细不能为空")
    List<MateInventoryCxLogUpdateRequestMateItem> items;

    @Data
    public static class MateInventoryCxLogUpdateRequestMateItem {
        @Schema(description = "原库存ID")
        @NotNull(message = "原库存ID不能为空")
        private Long beforeMateInventoryId;

        @Schema(description ="拆后商品SKU")
        @NotNull(message = "拆后商品SKU不能为空")
        private String afterMateSku;

        @Schema(description ="拆后商品名称")
        @NotNull(message = "拆后商品名称不能为空")
        private String afterMateSkuName;

        @Schema(description ="被拆数量")
        @NotNull(message = "被拆数量不能为空")
        private Integer beforeQty;
    }

}
